<?php include("header.php"); ?>

<table>
  <caption>Vizsgák</caption>
  <thead>
  <tr>
    <th rowspan="2" id="HH.ev">Év</th>
    <th rowspan="2" id="HH.honap">Hónap</th>
    <th rowspan="2" id="HH.nap">Nap</th>
    <th rowspan="2" id="HH.cim">Vizsga címe</th>
    <th colspan="2" id="HH.kurzusok">Kurzusok</th>
    <th rowspan="2" id="HH.letrehozo"> Létrehozó </th>
   </tr>
  <tr>
  	<?php foreach($t->get('kurzusok') as $row): ?>
    <th><?php echo $row['nev'] ?></th>
	<?php endforeach; ?>
   </tr>
  </thead>
   <tbody>
	<?php foreach($t->get('vizsgak') as $row): ?>
	  <tr>
		<td><?php echo date("Y", $row['time']) ?></td>
		<td><?php echo Template::$months[date("m", $row['time'])] ?></td>
		<td><?php echo date("j", $row['time']) ?></td>
		<td headers="HH.cim"><a href="<?php $t->link('student_exam') ?>&amp;vizsga_id=<?php echo $row['vizsga_id'] ?>"><?php echo $row['cim'] ?></a></td>
		<?php foreach($row['vizsga_kurzus'] as $checked): ?>
		<td headers="HH.kurzusok">
			<?php if($checked): ?><img alt="checked" src="checked.jpg" /><?php else: ?>&nbsp;<?php endif; ?>
	    </td>
		<?php endforeach; ?>
		<td headers="HH.letrehozo"><?php echo $row['tanar_nev'] ?></td>
	  </tr>
	<?php endforeach; ?>
 </tbody>
</table>

<?php include("footer.php"); ?>
